package com.example.javaweb;

import java.util.Collection;
import java.util.HashMap;

public class CakeDB {
   private static HashMap<String,Cake>  map = new HashMap();
   static {
       map.put("1",new Cake("1","奶昔蛋糕"));
       map.put("2",new Cake("2","蜂蜜蛋糕"));
       map.put("3",new Cake("3","香蕉蛋糕"));
       map.put("4",new Cake("4","苹果蛋糕"));
       map.put("5",new Cake("5","草莓蛋糕"));
   }
   public static Collection<Cake> getAll(){
       return map.values();
   }
   public  static  Cake getCakeById(String id){
       return map.get(id);
   }
}
